package com.cun.provider.mapper;

import java.util.List;

import com.cun.provider.entiry.TQuoteParamSet;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.JdbcType;

public interface TQuoteParamSetMapper {
    @Delete({
        "delete from t_quote_param_set",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into t_quote_param_set (id, param_set_content, ",
        "param_set_value, enable, ",
        "param_type, param_set_id_child, ",
        "param_value, param_content)",
        "values (#{id,jdbcType=BIGINT}, #{paramSetContent,jdbcType=VARCHAR}, ",
        "#{paramSetValue,jdbcType=VARCHAR}, #{enable,jdbcType=TINYINT}, ",
        "#{paramType,jdbcType=VARCHAR}, #{paramSetIdChild,jdbcType=VARCHAR}, ",
        "#{paramValue,jdbcType=VARCHAR}, #{paramContent,jdbcType=VARCHAR})"
    })
    int insert(TQuoteParamSet record);

    @Select({
        "select",
        "id, param_set_content, param_set_value, enable, param_type, param_set_id_child, ",
        "param_value, param_content",
        "from t_quote_param_set",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="param_set_content", property="paramSetContent", jdbcType=JdbcType.VARCHAR),
        @Result(column="param_set_value", property="paramSetValue", jdbcType=JdbcType.VARCHAR),
        @Result(column="enable", property="enable", jdbcType=JdbcType.TINYINT),
        @Result(column="param_type", property="paramType", jdbcType=JdbcType.VARCHAR),
        @Result(column="param_set_id_child", property="paramSetIdChild", jdbcType=JdbcType.VARCHAR),
        @Result(column="param_value", property="paramValue", jdbcType=JdbcType.VARCHAR),
        @Result(column="param_content", property="paramContent", jdbcType=JdbcType.VARCHAR)
    })
    TQuoteParamSet selectByPrimaryKey(Long id);

    @Select({
        "select",
        "id, param_set_content, param_set_value, enable, param_type, param_set_id_child, ",
        "param_value, param_content",
        "from t_quote_param_set"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="param_set_content", property="paramSetContent", jdbcType=JdbcType.VARCHAR),
        @Result(column="param_set_value", property="paramSetValue", jdbcType=JdbcType.VARCHAR),
        @Result(column="enable", property="enable", jdbcType=JdbcType.TINYINT),
        @Result(column="param_type", property="paramType", jdbcType=JdbcType.VARCHAR),
        @Result(column="param_set_id_child", property="paramSetIdChild", jdbcType=JdbcType.VARCHAR),
        @Result(column="param_value", property="paramValue", jdbcType=JdbcType.VARCHAR),
        @Result(column="param_content", property="paramContent", jdbcType=JdbcType.VARCHAR)
    })
    List<TQuoteParamSet> selectAll();

    @Update({
        "update t_quote_param_set",
        "set param_set_content = #{paramSetContent,jdbcType=VARCHAR},",
          "param_set_value = #{paramSetValue,jdbcType=VARCHAR},",
          "enable = #{enable,jdbcType=TINYINT},",
          "param_type = #{paramType,jdbcType=VARCHAR},",
          "param_set_id_child = #{paramSetIdChild,jdbcType=VARCHAR},",
          "param_value = #{paramValue,jdbcType=VARCHAR},",
          "param_content = #{paramContent,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(TQuoteParamSet record);
}